﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreEx.Database.Metadata;
using LinFu.IoC.Configuration;

namespace CoreEx.Database.MetaData.Implementation
{
    [Serializable]
    [Implements(typeof(IColumnInfo))]
    public class ColumnInfo : IColumnInfo
    {
        public ITableInfo Table { get; set; }        
        public string ColumnName { get; set; }
        public Type DataType { get; set; }
        public int OrdinalPosition { get; set;}
        public bool IsNullable { get; set;}        

        public override string ToString()
        {
            if (ColumnName != null)
                return string.Format("{0} ({1})", ColumnName, DataType.Name);
            return base.ToString();
        }
    }
}
